package class202205.demo31.demo26.enumdemo;

public enum TestEnum {
    RED,BLACK,GREEN,WHITE;

    public static void main(String[] args) {

        TestEnum testEnums = TestEnum.valueOf("RED");
        System.out.println(testEnums);

        System.out.println(RED.compareTo(GREEN));
        System.out.println(BLACK.compareTo(RED));

        /*TestEnum[] testEnums = TestEnum.values();
        for (int i = 0; i < testEnums.length; i++) {
            System.out.println(testEnums[i]+"--->"+testEnums[i].ordinal());
        }*/
    }

    public static void main1(String[] args) {
        TestEnum testEnum2 = TestEnum.BLACK;
        switch (testEnum2) {
            case RED: System.out.println("red");
                break;
            case BLACK: System.out.println("black");
                break;
            case WHITE: System.out.println("WHITE");
                break;
            case GREEN: System.out.println("black");
                break;
            default:
                break; }
    }
}
